package abstractclassunderstand;

abstract class Shape {
    //抽象方法
    public abstract void draw();
}

abstract class A extends Shape {

}
class B extends A {
    @Override
    public void draw() {
        System.out.println("dsfsasa");
    }
}



class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("矩形！");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画圆！");
    }
}

class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个三角形！");
    }
}

class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("❀！");
    }
}
public class Test1 {


    public static void drawMap(Shape shape) {
        shape.draw();
    }
    public static void main(String[] args) {
        Rect rect = new Rect();
        drawMap(rect);
        drawMap(new Cycle());
        drawMap(new Triangle());
        drawMap(new Flower());
    }

    public static void main1(String[] args) {
        //Shape shape = new Shape();
        Shape shape = new Rect();
    }
}